// 引入axios
const axios = require("axios")

// 设置公共服务器地址
axios.defaults.baseURL = 'http://fitness.h5.itsource.cn:3701';
// 携带token
let token = localStorage.getItem("token");  //获取token数据
if(token){
    axios.defaults.headers.common['Authorization'] = 'Bearer '+token;
}

// 暴露axios
module.exports = axios;